import { getVshiList,} from '../services/api';
import { getAuthority,setAuthority } from '../utils/authority';

export default {
  namespace: 'video',

  state: {
    data: {},
    loading:true,
    position:-1,
    prePosition: -1,
    netErr:false,
    shoudPlay:true,
  },

  effects: {
    *getList({ payload }, { call, put }){
      const response = yield call(getVshiList,payload);
      console.log(response);
      yield put({
        type: 'saveList',
        payload: response,
      });
    },
  },
  reducers: {
    saveList(state, action) {
      console.log(action);
      return {
        ...state,
        data:action.payload
      };
      
    },
    logOut(state, action) {
      return {
        ...state,
        isLogin:false
      };
    },
  },
};
